<%-- 创建时间 : 2010.06.03
             创建人:xiuzhiming
             功能描述：索赔申请上报功能首页，用于查询和上报索赔申请单。 
--%>
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.infodms.dms.common.Constant" %>
<%
	String contextPath = request.getContextPath();
%>
<%@page import="com.infodms.dms.common.Constant"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>索赔申请上报</title>
<jsp:include page="${contextPath}/common/jsp_head_new.jsp" />
<script type="text/javascript">
    function doInit()
	{
	   loadcalendar();
	}
</script>
</head>
<body onload="doInit();">
  <div class="navigation"><img src="<%=contextPath%>/img/nav.gif" />
              当前位置： 售后服务管理&gt;经销商索赔管理&gt;索赔单上报
  </div>
  <form method="post" name="fm">
    <TABLE align="center" class="table_query" >
          <tr>
            <td align="right" nowrap="true">索赔单号：</td>
            <td>
            	<input name="CLAIM_NO" value="" type="text" class="middle_txt">
            </td>
            <td align="right" nowrap="true">工单号：</td>
            <td align="left">
              <input type="text" name="RO_NO" value="" class="middle_txt"/>
              <input name="LINE_NO" value="" type="hidden"   class="mini_txt" >
            </td>	            
          </tr>
          <tr>
            <td align="right" nowrap="true">索赔类型：</td>
            <td>
				<script type="text/javascript">
				    genSelBoxExp("CLAIM_TYPE",<%=Constant.CLA_TYPE%>,"",true,"short_sel","","true",'');
				</script>
 		    </td> 	
 		    <td align="right" nowrap="true" rowspan="2">VIN：</td>
 			<td align="left" rowspan="2">
 			    <textarea name="VIN" rows="3" cols="18"></textarea>
 			    <!-- 只有未上报的索赔申请单可以上报 -->
 				<input type="hidden" name="CLAIM_STATUS" id="CLAIM_STATUS" value="<%=Constant.CLAIM_APPLY_ORD_TYPE_01%>"/>
 			</td>         
          </tr>                   
          <tr>
            <td align="right" nowrap="true" >申请日期： </td>
            <td nowrap="true">
	            <input type="text" name="APPLY_DATE_START" id="APPLY_DATE_START"
	             value="" type="text" class="short_txt" 
	             datatype="1,is_date,10" group="APPLY_DATE_START,APPLY_DATE_END" 
	             hasbtn="true" callFunction="showcalendar(event, 'APPLY_DATE_START', false);"/>
	             &nbsp;至&nbsp;
	 			<input type="text" name="APPLY_DATE_END" id="APPLY_DATE_END" 
	 			value="" type="text" class="short_txt" datatype="1,is_date,10" 
	 			group="APPLY_DATE_START,APPLY_DATE_END" 
	 			hasbtn="true" callFunction="showcalendar(event, 'APPLY_DATE_END', false);">
	        </td>
          </tr>
    	  <tr>
            <td align="center" colspan="4" nowrap="true">
            	<input class="normal_btn" type="button" name="queryBtn1" id="queryBtn" value="查询"  onClick="__extQuery__(1);" >
			</td>
		</tr>
  </table>
  <script type="text/javascript" >
		var myPage;
		var url = "<%=contextPath%>/claim/dealerClaimMng/DealerClaimReport/dealerClaimReportQuery.json";
		var title = null;
		
		var columns = [
					{header: "索赔申请单号",sortable: false,dataIndex: 'CLAIM_NO',align:'center'},
					//{header: "经销商代码",sortable: false,dataIndex: 'DEALER_CODE',align:'center'},
					//{header: "经销商名称",sortable: false,dataIndex: 'DEALER_NAME',align:'center'},				
					{id:'action', header: "工单号",dataIndex: 'RO_NO',renderer:claimDetail},
					{header: "索赔类型",sortable: false,dataIndex: 'CLAIM_TYPE',align:'center',renderer:getItemValue}, 
					{header: "提交次数",sortable: false,dataIndex: 'SUBMIT_TIMES',align:'center'},
					{header: "VIN",sortable: false,dataIndex: 'VIN',align:'center'},
					{header: "申请日期",sortable: false,dataIndex: 'CREATE_DATE',align:'center'},
					{header: "申请状态",sortable: false,dataIndex: 'STATUS',align:'center',renderer:getItemValue},
					{id:'action',header: "操作",dataIndex: 'ID',renderer:claimReport}
			      ];
	      
		//需要挂接索赔申请状态查询的明细查询功能
		function claimDetail(value,meta,record){
			var width=900;
			var height=500;

			var screenW = window.screen.width-30;	
			var screenH = document.viewport.getHeight();

			if(screenW!=null && screenW!='undefined')
				width = screenW;
			if(screenH!=null && screenH!='undefined')
				height = screenH;
			
		    return String.format("<a href='#' onclick=\"OpenHtmlWindow('<%=contextPath%>/claim/dealerClaimMng/ClaimBillTrack/claimBillDetailForward.do?ID="
					+ record.data.ID + "',"+width+","+height+")\">[" + value + "]</a>");
	    }   

	    function claimReport(value,meta,record){
		    var money = record.data.GROSS_CREDIT;
		    var type = record.data.CLAIM_TYPE;
		    return String.format("<a href=\"#\" onclick=confirm("+value+","+money+","+type+",this) >[上报]</a>");
	    }

	    function confirm(value,money,type,aobj) {
		   	if(type == <%=Constant.CLA_TYPE_02%> && money == 0){
				MyAlert('常规保养不能上报!');
				return false ;
		   	}	
			MyConfirm("是否确认上报？",reportClaim,[value,aobj]);
		}

	    //上报索赔申请单
		function reportClaim(value,aobj){
			disableLink(aobj);
			makeNomalFormCall('<%=contextPath%>/claim/dealerClaimMng/DealerClaimReport/reportClaim.json?ID='+ value,showResult,'fm');
		}
	
		function showResult(json){
			if(json.ACTION_RESULT == '1'){
				 __extQuery__(1);
			}
		}

		function disableLink(obj){
			obj.disabled = true;
			obj.style.border = '1px solid #999';
			obj.style.background = '#EEE';
			obj.style.color = '#999';
		}
  </script>
</form>
<!--分页  -->
<jsp:include page="${contextPath}/queryPage/orderHidden.html" />
<jsp:include page="${contextPath}/queryPage/pageDiv.html" />
</body>
</html>